//
//  PhotoViewController.h
//  TestPhotoMS
//
//  Created by Hung Nguyen Thanh on 10/2/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "UITableViewCellWithIconList.h"

#import "XMLProcess.h"
#import "Photo.h"

typedef enum {
    TOP_RATED,
    MY_PHOTO
}PhotoMode;

@protocol PhotoViewDelegate;

@interface PhotoViewController : UIViewController<XMLProcessDelegate, UITableViewDelegate, UITableViewDataSource, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UITableViewCellWithIconListDelegate>
@property (strong, nonatomic) IBOutlet UIImageView *photoImageView;
@property (strong, nonatomic) Photo *photo;
@property (nonatomic, assign) id<PhotoViewDelegate>delegate;
@property (strong, nonatomic) NSMutableArray *listPhoto;

@property (nonatomic, assign) NSInteger numOfCell;
@property (nonatomic, assign) NSInteger numOfIconInCell;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicatorView;
@property (weak, nonatomic) IBOutlet UITableView *photoTableView;
@property (weak, nonatomic) IBOutlet UISegmentedControl *segmentedControl;



- (IBAction)logout:(id)sender;
- (IBAction)camera:(id)sender;
- (IBAction)modeLoadChange:(id)sender;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil photo:(Photo *)aPhot;

- (void)handleTap:(UITapGestureRecognizer *)gestureRecognizer;

- (void)loadPhotoFromServer:(PhotoMode)mode;
- (NSData *)dataForPOSTWithDictionary:(NSDictionary *)aDictionary boundary:(NSString *)aBoundary ;
- (void)uploadImage:(UIImage*)image;
@end

@protocol PhotoViewDelegate <NSObject>
    
- (void)photoViewDidEnd:(PhotoViewController *)photoviewController;

@end